//
//  KIImagePager.h
//  KIImagePager
//
//  Created by Marcus Kida on 07.04.13.
//  Copyright (c) 2013 Marcus Kida. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>

@class KIImagePager;

#pragma mark 数据源KIImagePagerDataSource
@protocol KIImagePagerDataSource <NSObject>

@required
/**图片地址数组*/
- (NSArray *) arrayWithImages;
/**图片填充类型*/
- (UIViewContentMode) contentModeForImage:(NSUInteger)index;

@optional
/**默认填充图片*/
- (UIImage *) placeHolderImageForImagePager;

/**
 *  图片上面的标题Label
 *
 *  @param index 轮播图的tag
 *
 *  @return 对应图片的lable.text内容
 */
- (NSString *) captionForImageAtIndex:(NSUInteger)index;

/**默认图片填充类型*/
- (UIViewContentMode) contentModeForPlaceHolder;

@end

#pragma mark    代理KIImagePagerDelegate
@protocol KIImagePagerDelegate <NSObject>

@optional
- (void) imagePager:(KIImagePager *)imagePager didScrollToIndex:(NSUInteger)index;
- (void) imagePager:(KIImagePager *)imagePager didSelectImageAtIndex:(NSUInteger)index;

@end

@interface KIImagePager : UIView

// Delegate and Datasource
@property (weak) IBOutlet id <KIImagePagerDataSource> dataSource;
@property (weak) IBOutlet id <KIImagePagerDelegate> delegate;

// General
@property (nonatomic) UIViewContentMode contentMode;
@property (nonatomic) UIScrollView *scrollView;
@property (nonatomic) UIPageControl *pageControl;
@property (nonatomic) NSUInteger currentPage;

/**是否显示指示器(UIPageControl),YES=隐藏,NO=显示,默认为NO*/
@property (nonatomic) BOOL indicatorDisabled;

/**轮播图滑到边界时是否可以继续滑动,YES=可以,NO=不可以,默认为YES*/
@property (nonatomic) BOOL bounces;

/**是否在右下角显示小照相机图标和图片数量,NO=显示,YES=隐藏,默认为YES*/
@property (nonatomic) BOOL imageCounterDisabled;

/**轮播图只有一张图片时,是否隐藏指示器(UIPageControl),YES=隐藏,NO=显示,默认隐藏*/
@property (nonatomic) BOOL hidePageControlForSinglePages; // Defaults YES

// Slideshow
/**滚动间隔时间*/
@property (nonatomic) NSUInteger slideshowTimeInterval; // Defaults 0.0f (off)
@property (nonatomic) BOOL slideshowShouldCallScrollToDelegate; // Defaults YES

// Caption Label 标题Label
@property (nonatomic, strong) UIColor *captionTextColor; // Defaults Black
@property (nonatomic, strong) UIColor *captionBackgroundColor; // Defaults White (with an alpha of .7f)
@property (nonatomic, strong) UIFont *captionFont; // Defaults to Helvetica 12.0f points

- (void) reloadData;
- (void) setCurrentPage:(NSUInteger)currentPage animated:(BOOL)animated;

@end

